package constants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

@SuppressWarnings("serial")
public class EnvironmentConstants {

	public static final String CORE = "1";
	public static final String CRM = "2";

	public static final Integer DEV_ENVIRONMENT = 1;
	public static final Integer TEST_ENVIRONMENT = 2;
	public static final Integer KKT_ENVIRONMENT = 3;
	public static final Integer PREPROD_ENVIRONMENT = 4;
	public static final Integer CRMDEV_ENVIRONMENT = 5;
	public static final Integer CRMTEST_ENVIRONMENT = 6;
	public static final Integer SAKLAMADEV_ENVIRONMENT = 7;
	public static final Integer SAKLAMATEST_ENVIRONMENT = 8;

	public static final Integer PROD_ENVIRONMENT = 9;
	
	public static final Integer DEVGEN01 = 1;
//	public static final Integer DEVGEN02 = 2;
	public static final Integer DEVAPP01 = 3;
	public static final Integer DEVAPP02 = 4;

	public static final Integer TESTGEN01 = 5;
	public static final Integer TESTGEN02 = 6;
	public static final Integer TESTAPP02 = 7;
	public static final Integer TESTAPP04 = 8;
	public static final Integer TESTOLTP = 9;

	public static final Integer KKTGEN01 = 10;
	public static final Integer KKTGEN02 = 11;

	public static final Integer CBPREP = 12;
	public static final Integer CBPREGEN01 = 13;
	public static final Integer CBPREGEN02 = 14;

	public static final Integer OCRMDEV = 15;
	
	public static final Integer OCRMTEST = 16;

	public static final Integer CBTSTAPP04 = 17;
	
//	Saklama Bankasi
	public static final Integer SBDEVAPP01 = 18;
	public static final Integer SAKLABANKDEV = 19;
	
	public static final Integer SBTSTAPP01 = 20;


	public static final TreeMap<String, Integer> ENVIRONMENT_LIST = new TreeMap<String, Integer>(){{
		put("1 - DEV", DEV_ENVIRONMENT );
		put("2 - TEST" ,TEST_ENVIRONMENT );
		put("3 - KKT" ,KKT_ENVIRONMENT );
		put("4 - PREPROD" ,PREPROD_ENVIRONMENT );
		put("5 - DEV CRM" ,CRMDEV_ENVIRONMENT );
		put("6 - TEST CRM" ,CRMTEST_ENVIRONMENT );
		put("7 - DEV SAKB" ,SAKLAMADEV_ENVIRONMENT );
		put("8 - TEST SAKB" ,SAKLAMATEST_ENVIRONMENT );
	}};
	
	public static final Map<Integer, String> DEV_SERVERS = new HashMap<Integer, String>(){{
		put(DEVGEN01 , "cbdevgen01");
//		put(DEVGEN02 , "cbdevgen02");
		put(DEVAPP02 , "cbdevapp02");
	}};
	
	public static final Map<Integer, String> TEST_SERVERS = new HashMap<Integer, String>(){{
		put(TESTOLTP , "cbtstoltp");
		put(TESTGEN01 , "cbtstgen01");
		put(TESTGEN02 , "cbtstgen02");
		put(TESTAPP02 , "cbtstapp02");
		put(TESTAPP04 , "cbtstapp04");
	}};

	public static final Map<Integer, String> KKT_SERVERS = new HashMap<Integer, String>(){{
		put(KKTGEN01 , "cbkktgen01");
		put(KKTGEN02 , "cbkktgen02");
	}};
	
	public static final Map<Integer, String> PREPROD_SERVERS = new HashMap<Integer, String>(){{
		put(CBPREP , "cbprep");
//		put(CBPREP , "fbprepesi");
		put(CBPREGEN01 , "cbpregen01");
		put(CBPREGEN02 , "cbpregen02");
//		put(CBPREGEN01 , "cbprepapp01");
//		put(CBPREGEN02 , "cbprepapp02");
	}};
	
	public static final Map<Integer, String> CRMDEV_SERVERS = new HashMap<Integer, String>(){{
		put(OCRMDEV , "ocrmdev");
		put(DEVAPP01 , "cbdevapp01");
		
	}};
	
	public static final Map<Integer, String> CRMTEST_SERVERS = new HashMap<Integer, String>(){{
		put(OCRMTEST , "ocrmtst");
		put(CBTSTAPP04 , "cbtstapp04");
	}};
	
	public static final Map<Integer, String> SAKLAMADEV_SERVERS = new HashMap<Integer, String>(){{
		put(SBDEVAPP01 , "sbdevapp01");
		put(SAKLABANKDEV , "saklabankdev");
		
	}};
	
	public static final Map<Integer, String> SAKLAMATEST_SERVERS = new HashMap<Integer, String>(){{
		put(SBTSTAPP01 , "sbtstapp01");
	}};
	
	
	public static final List<Integer> DEV_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(DEVAPP02);
		add(DEVAPP01);
//		add(DEVGEN02);
		add(DEVGEN01);
	}};
	
	public static final List<Integer> TEST_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(TESTOLTP);
	}};

	public static final List<Integer> KKT_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(KKTGEN01);
		add(KKTGEN02);
	}};
	
	public static final List<Integer> PREPROD_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(CBPREP);
	}};

	public static final List<Integer> DEV_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(DEVGEN01);
		add(DEVAPP01);
		add(DEVAPP02);
	}};

	public static final List<Integer> TEST_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(TESTGEN01);
		add(TESTGEN02);
		add(TESTAPP02);
		add(TESTAPP04);
	}};
	
	public static final List<Integer> KKT_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(KKTGEN01);
		add(KKTGEN02);
	}};

	public static final List<Integer> PREPROD_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(CBPREGEN01);
		add(CBPREGEN02);
	}};
	
	public static final List<Integer> CRMDEV_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(OCRMDEV);
	}};
	
	public static final List<Integer> CRMTEST_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(OCRMTEST);
	}};
	
	public static final List<Integer> CRMDEV_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(DEVAPP01);
	}};
	
	public static final List<Integer> CRMTEST_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(CBTSTAPP04);
	}};

	public static final List<Integer> SAKLAMADEV_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(SAKLABANKDEV);
	}};
	
	public static final List<Integer> SAKLAMATEST_CALL_ORDER_PLM = new ArrayList<Integer>(){{
		add(SBTSTAPP01);
	}};
	
	public static final List<Integer> SAKLAMADEV_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(SBDEVAPP01);
	}};
	
	public static final List<Integer> SAKLAMATEST_CALL_ORDER_ESI = new ArrayList<Integer>(){{
		add(SBTSTAPP01);
	}};
	
	public static final List<Integer> PORTS = new ArrayList<Integer>(){{
		add(10001);
		add(10002);
		add(10003);
		add(10004);
		add(10005);
	}};
	
	public static final Map<Integer, Map<Integer, String>> SERVERS = new HashMap<Integer, Map<Integer, String>>(){{
       put(DEV_ENVIRONMENT , DEV_SERVERS);
       put(TEST_ENVIRONMENT , TEST_SERVERS);
       put(KKT_ENVIRONMENT , KKT_SERVERS);
       put(PREPROD_ENVIRONMENT , PREPROD_SERVERS);
       put(CRMDEV_ENVIRONMENT , CRMDEV_SERVERS);
       put(CRMTEST_ENVIRONMENT , CRMTEST_SERVERS);
       put(SAKLAMADEV_ENVIRONMENT , SAKLAMADEV_SERVERS);
       put(SAKLAMATEST_ENVIRONMENT , SAKLAMATEST_SERVERS);
	}};

	public static final Map<Integer, List<Integer>> CALL_ORDERS_PLM = new HashMap<Integer, List<Integer>>(){{
       put(DEV_ENVIRONMENT , DEV_CALL_ORDER_PLM);
       put(TEST_ENVIRONMENT , TEST_CALL_ORDER_PLM);
       put(KKT_ENVIRONMENT , KKT_CALL_ORDER_PLM);
       put(PREPROD_ENVIRONMENT , PREPROD_CALL_ORDER_PLM);
       put(CRMDEV_ENVIRONMENT , CRMDEV_CALL_ORDER_PLM);
       put(CRMTEST_ENVIRONMENT , CRMTEST_CALL_ORDER_PLM);
       put(SAKLAMADEV_ENVIRONMENT , SAKLAMADEV_CALL_ORDER_PLM);
       put(SAKLAMATEST_ENVIRONMENT , SAKLAMATEST_CALL_ORDER_PLM);
	}};

	public static final Map<Integer, List<Integer>> CALL_ORDERS_ESI = new HashMap<Integer, List<Integer>>(){{
       put(DEV_ENVIRONMENT , DEV_CALL_ORDER_ESI);
       put(TEST_ENVIRONMENT , TEST_CALL_ORDER_ESI);
       put(KKT_ENVIRONMENT , KKT_CALL_ORDER_ESI);
       put(PREPROD_ENVIRONMENT , PREPROD_CALL_ORDER_ESI);
       put(CRMDEV_ENVIRONMENT , CRMDEV_CALL_ORDER_ESI);
       put(CRMTEST_ENVIRONMENT , CRMTEST_CALL_ORDER_ESI);
       put(SAKLAMADEV_ENVIRONMENT , SAKLAMADEV_CALL_ORDER_ESI);
       put(SAKLAMATEST_ENVIRONMENT , SAKLAMATEST_CALL_ORDER_ESI);
	}};


	public static final Map<Integer, String> ENV_DEPLOYENV = new HashMap<Integer, String>(){{
		put(DEV_ENVIRONMENT , "dev");
		put(TEST_ENVIRONMENT , "alfa");
		put(KKT_ENVIRONMENT , "uat");
		put(PREPROD_ENVIRONMENT , "preprod");
	}};

	public static final Map<Integer, String> ENV_SOURCEDB = new HashMap<Integer, String>(){{
		put(DEV_ENVIRONMENT , "cbdev01");
		put(TEST_ENVIRONMENT , "cbdev01");
		put(KKT_ENVIRONMENT , "cbdev01");
		put(PREPROD_ENVIRONMENT , "cbtst01");
	}};

	public static final Map<Integer, String> ENVIR_PRINTSERVER = new HashMap<Integer, String>(){{
		put(DEV_ENVIRONMENT , "cbdevapp02");
		put(TEST_ENVIRONMENT , "cbtstout");
		put(KKT_ENVIRONMENT , "cbkktout01");
		put(PREPROD_ENVIRONMENT , "cbpreout01");
	}};
	
	
	public static List<String> getAppropriateServers(String xmlType, Integer environment){
		List<String> allServers = new ArrayList<String>();
		
		return allServers;
	}
}
